using System.Collections;
using System.Collections.Generic;
using UnityEngine;
namespace RobotSimulator.Basic
{
    public delegate void BeforeControl();
    public class RobotController : BasicPublisher
    {
        public bool contorl_flag = false;
        public BeforeControl beforeControl = (() => { });
        public virtual void Control()
        {

        }
        // Start is called before the first frame update
        //protected override void Start()
        //{
        //    base.Start();
        //    //if (control_target == null)
        //    //{
        //    //    control_target = GetComponent<BasicRobot>();

        //    //}
        //}

        protected override void Loop()
        {
            if (contorl_flag)
            {
                loop();
            }
        }
        protected virtual void loop()
        {
            beforeControl();
            Control();
        }
    }
}


